package com.example.myworkc;

import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import android.app.Fragment;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class meBlankFragment extends Fragment {
    private TextView textView2_me;
    public meBlankFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup conmetainer,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.me_blank,conmetainer, false);
        textView2_me=view.findViewById(R.id.textView2_me);
        String string="微信号:xxx";
        textView2_me.setText(string);
        String[] name={"支付","收藏","表情","设置"};
        int[] png={R.drawable.zf, R.drawable.sc,R.drawable.bq, R.drawable.config};
        List<Map<String, Object>> listitem = new ArrayList<Map<String, Object>>();
        for (int i = 0; i < name.length; i++) {
            Map<String, Object> showitem = new HashMap<String, Object>();
            showitem.put("png", png[i]);
            showitem.put("name", name[i]);
            listitem.add(showitem);
        }
        SimpleAdapter myAdapter = new SimpleAdapter(view.getContext(), listitem, R.layout.item4, new String[]{"png", "name"}, new int[]{R.id.imageView_me, R.id.textView_me});
        ListView listView = view.findViewById(R.id.list_view_me);
        listView.setAdapter(myAdapter);
        return view;
    }
}